import request from "./request";
const ADD_USER = "/users";
const DEL = "/users";
import qs from "querystring";

//! 获取内容
function adduser(params) {
  return request({
    method: "get",
    url: ADD_USER + "?" + qs.stringify(params),
  });
}

//! 添加
function addUseR(obj) {
    return request({
      method: "post",
      url: ADD_USER,
      data: obj,
    });
  }

//! 修改
function Edit(id, obj) {
  return request({
    method: "put",
    url: `/users/` + id,
    data: obj,
  });
}

//! 修改状态
function swait(id, obj) {
  return request({
    method: "put",
    url: `users/${id}/state/` + obj,
    data: obj,
  });
}

//! 删除
function Del(id) {
  return request({
    method: "delete",
    url: "users/" + id,
  });
}
export { adduser, Del, Edit, swait,addUseR };
